// 导入 路由
import VueRouter from 'vue-router';

// 导入 tabbar 组件
import HomeContainer from './components/tabbar/HomeContainer.vue';
import MemberContainer from './components/tabbar/MemberContainer.vue';
import SearchContainer from './components/tabbar/SearchContainer.vue';
import ShopcarContainer from './components/tabbar/ShopcarContainer.vue';

// 导入 news 组件
import newsList from "./components/news/newsList.vue";
import newsArticle from "./components/news/newsArticle.vue";

// 图片组件
import potosList from "./components/potos/potosList.vue";
import potosInfo from "./components/potos/potosInfo.vue";

// 商品组件
import goodsList from "./components/goods/goodsList.vue";
import goodsInfo from "./components/goods/goodsInfo.vue";
import goodsDesc from "./components/goods/goodsDesc.vue";
import goodsComment from "./components/goods/goodsComment.vue";

// 创建路由
var router = new VueRouter({
    routes: [
        { path: '/', redirect: '/home'  },
        { path: '/home', component: HomeContainer },
        { path: '/member', component: MemberContainer },
        { path: '/search', component: SearchContainer },
        { path: '/shopcar', component: ShopcarContainer },
        { path: '/home/newslist', component: newsList },
        { path: '/home/newsinfo/:id', component: newsArticle },
        { path: '/home/share', component: potosList },
        { path: '/home/potosinfo/:id', component: potosInfo },
        { path: '/home/goodslist', component: goodsList },
        { path: '/home/goodsInfo/:id', component: goodsInfo, name: 'goodsInfo' },
        { path: '/home/goodsDesc/:id', component: goodsDesc, name: 'goodsDesc' },
        { path: '/home/goodsComment/:id', component: goodsComment, name: 'goodsComment'}
    ],
    linkActiveClass: 'mui-active'
});

export default router;